<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>附件管理</title>
<script type="text/javascript">
	var $grid;
	$(function() {
		$grid = $("#grid").datagrid($.extend(datagridOption, {
			url : "${ctx}/basic/basicFile/showDataGrid",
			columns : [ [ {
				field : 'ck',
				checkbox : true
			}, {
				field : 'fileName',
				title : '文件名',
			}, {
				field : 'fileSize',
				title : '文件大小',
				width : 60,
				formatter : function(val) {
					return val + "KB";
				},
				styler : function(value, row, index) {
					return 'text-align:right;';
				}
			}, {
				field : 'filePath',
				title : '文件目录'
			}, {
				field : 'fileType',
				title : '文件类型'
			}, {
				field : 'uploader',
				title : '上传者',
				width : 80
			}, {
				field : 'uploadTime',
				title : '上传时间',
				width : 120
			}, {
				field : 'downloader',
				title : '下载人',
				width : 80
			}, {
				field : 'lastDownloadTime',
				title : '最近下载时间',
				width : 120
			} ] ]
		}));

		$grid.datagrid('enableFilter', [ {
			filed : 'uploadTime',
			NoFilter : true
		}, {
			field : 'lastDownloadTime',
			NoFilter : true
		} ]);
		$("#btn-search").click(function() {
			$grid.datagrid('load', $("#tt").form("getData"));
		});
		$("#btn-delete").click(function() {
			multiDeleteDataGrid($grid, "${ctx}/basic/basicFile/multiDelete");
		});
	});
</script>
</head>
<body>
	<div data-options="region:'center',fit:true,border:false">
		<table id="grid" data-options="fit:true">
		</table>
		<div id="tt" class="row">
		<div class="col-md-8">
			<shiro:hasPermission name="basicFile:list">
			<form class="form-grid-search form-inline">
				<div class="form-group">
					<span>上传时间从：</span>
					<input type="text" class="easyui-datetimebox" datefmt="yyyy-MM-dd HH:mm:ss" name="search_GT-T_uploadTime" placeholder="yyyy-MM-dd HH:mm:ss" />
					<span>到：</span>
					<input type="text" class="easyui-datetimebox" datefmt="yyyy-MM-dd HH:mm:ss" name="search_LT-T_uploadTime" placeholder="yyyy-MM-dd HH:mm:ss" />
				</div>
				<button type="button" id="search" class="btn btn-primary">
					<span class="glyphicon glyphicon-search"></span> 查询
				</button>
			</form>
			</shiro:hasPermission>
			</div>
			<div class="col-md-4">
			<shiro:hasPermission name="basicFile:delete">
				<button id="btn-delete" type="button" class="btn btn-danger">
					<span class="glyphicon glyphicon-minus"></span> 删除
				</button>
			</shiro:hasPermission></div>
		</div>
	</div>
</body>
</html>
